﻿using B.S.InOut.Domain;
using B.S.InOutErrorCode;
using MediatR;

namespace B.S.InOut.Read.API.Application.Command
{
    /// <summary>
    /// 插入出库信息命令类，实现 IRequest 接口，请求返回插入记录的 ID
    /// </summary>
    public class InsertOutMenageCommand : IRequest<int>
    {
        // 要插入的出库信息对象
        public Outmanagement Product { get; set; }

        // 构造函数，接收出库信息对象
        public InsertOutMenageCommand(Outmanagement product)
        {
            Product = product;
        }
    }

    /// <summary>
    /// 根据 ID 获取出库信息命令类，实现 IRequest 接口，请求返回产品对象
    /// </summary>
    public class GetOutMenageByIdCommand : IRequest<Outmanagement>
    {
        // 出库信息的 ID
        public int Id { get; set; }

        // 构造函数，接收出库信息 ID
        public GetOutMenageByIdCommand(int id)
        {
            Id = id;
        }
    }
    /// <summary>
    /// 获取所有出库信息命令类，实现 IRequest 接口，请求返回出库信息集合
    /// </summary>
    public class GetAllOutMenageCommand : IRequest<IEnumerable<Outmanagement>>
    {
    }

    /// <summary>
    /// 更新出库信息命令类，实现 IRequest 接口，请求返回受影响的行数
    /// </summary>
    public class UpdateOutMenageCommand : IRequest<int>
    {
        // 要更新的出库信息对象
        public Outmanagement Product { get; set; }

        // 构造函数，接收出库信息对象
        public UpdateOutMenageCommand(Outmanagement product)
        {
            Product = product;
        }
    }
    // 根据 ID 删除出库信息命令类，实现 IRequest 接口，请求返回受影响的行数
    public class DeleteOutMenageCommand : IRequest<int>
    {
        // 产品的 ID
        public int Id { get; set; }

        // 构造函数，接收出库信息 ID
        public DeleteOutMenageCommand(int id)
        {
            Id = id;
        }
    }

    /// <summary>
    /// 多条件分页查询产品命令
    /// </summary>
    public class GetOutMenageByConditionsCommand : IRequest<IEnumerable<Outmanagement>>
    {


        /// <summary>
        /// 产品名称（可空，作为查询条件）
        /// </summary>
        public string? Outboundnumber { get; set; }
        /// <summary>
        /// 最低价格（可空，作为查询条件）
        /// </summary>
        public int? Outbound { get; set; }
        /// <summary>
        /// 最高价格（可空，作为查询条件）
        /// </summary>
        public int? OutAuditstatus { get; set; }
        /// <summary>
        /// 页码
        /// </summary>
        public int pageindex { get; set; }
        /// <summary>
        /// 每页显示的记录数
        /// </summary>
        public int pageSize { get; set; }
        public GetOutMenageByConditionsCommand(string? outboundnumber, int? outbound, int? outAuditstatus, int pageindex, int pageSize)
        {
            this.Outboundnumber = outboundnumber;
            this.Outbound = outbound;
            this.OutAuditstatus = outAuditstatus;
            this.pageindex = pageindex;
            this.pageSize = pageSize;
        }


    }
    /// <summary>
    /// 批量删除产品命令
    /// </summary>
    public class DeleteOutManageCommand : IRequest<int>
    {
        /// <summary>
        /// 要删除的产品 ID 列表
        /// </summary>
        public IEnumerable<int> ProductIds { get; set; }

        /// <summary>
        /// 构造函数，初始化要删除的产品 ID 列表
        /// </summary>
        /// <param name="productIds">要删除的产品 ID 列表</param>
        public DeleteOutManageCommand(IEnumerable<int> productIds)
        {
            ProductIds = productIds;
        }
    }
    /// <summary>
    /// 联合查询 Outmanagement 和 ProductModel 表的命令
    /// </summary>
    public class GetOutmanagementWithProductModelCommand : IRequest<IEnumerable<OutmanagementProduct>>
    {
        /// <summary>
        /// 产品名称（可空，作为查询条件）
        /// </summary>
        public string? Outboundnumber { get; set; }
        /// <summary>
        /// 最低价格（可空，作为查询条件）
        /// </summary>
        public ApiOutbound? Outbound { get; set; }
        public ApiStatus? OutAuditstatus { get; set; }
        /// <summary>
        /// 页码
        /// </summary>
        public int pageindex { get; set; }
        /// <summary>
        /// 每页显示的记录数
        /// </summary>
        public int pageSize { get; set; }
        public GetOutmanagementWithProductModelCommand(string? outboundnumber, ApiOutbound? outbound, ApiStatus? outAuditstatus, int pageindex, int pageSize)
        {
            this.Outboundnumber = outboundnumber;
            this.Outbound = outbound;
            this.OutAuditstatus = outAuditstatus;
            this.pageindex = pageindex;
            this.pageSize = pageSize;
        }
    }


    /// <summary>
    /// 根据 ID 获取出库信息命令类，实现 IRequest 接口，请求返回产品对象
    /// </summary>
    public class GetOutProByIdAsyncCommand : IRequest<OutmanagementProduct>
    {
        // 出库信息的 ID
        public int Id { get; set; }

        // 构造函数，接收出库信息 ID
        public GetOutProByIdAsyncCommand(int id)
        {
            Id = id;
        }
    }
    /// <summary>
    /// 根据出库 ID 查询 Outmanagement 和 ProductModel 两表关联数据的命令
    /// </summary>
    public class GetOutmanagementAndProductModelByIdCommand : IRequest<OutmanagementProduct>
    {
        /// <summary>
        /// 出库 ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 构造函数，初始化出库 ID
        /// </summary>
        /// <param name="id">出库 ID</param>
        public GetOutmanagementAndProductModelByIdCommand(int id)
        {
            Id = id;
        }
    }

    /// <summary>
    /// 根据出库单号查询数据
    /// </summary>
    public class GetOutmanagemenByIdCommand : IRequest<IEnumerable<Outmanagement>>
    {
        /// <summary>
        /// 出库订单号
        /// </summary>
        public string Outboundnumber { get; set; }
        public GetOutmanagemenByIdCommand(string outboundnumber)
        {
            Outboundnumber = outboundnumber;
        }

       
       
    }
}
